{% extends "base.html" %}

{% import "bootstrap/wtf.html" as wtf %}

{% block page_content %}

<!--用于时间选择-->
<script src="{{ url_for('static', filename='js/moment-with-locales.js') }}"></script>
<link href="{{ url_for('static', filename='css/bootstrap-datetimepicker.min.css') }}" rel="stylesheet">
<script src="{{ url_for('static', filename='js/bootstrap-datetimepicker.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap-datetimepicker.zh-CN.js') }}"></script>
<script src="{{ url_for('static', filename='js/datetimepick.js') }}"></script>

<!--用于输入提示-->
<script src="{{ url_for('static', filename='js/bootstrap3-typeahead.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/typeahead.js') }}"></script>

<script src="{{ url_for('static', filename='js/getdata.js') }}"></script>

<div class="container-fluid">
    <table class="table table-striped col-md-7">
        <thead>
        <tr>
            <th>
                功能
            </th>
            <th>
                参数
            </th>
            <th>
                获取
            </th>
            <th>
                调用记录
            </th>
        </tr>
        </thead>
        <tbody>

        {% for item in t_items %}
        <tr>
            <form action="/fs_data" method="post">
                <td>
                    {{item.name}}
                    <br/>
                    table：{{item.table.name}}
                </td>
                <td>
                    <input name="id" value="{{item.id}}" hidden/>
                    {% if item.params %}
                    {% for param in item.params %}
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon">{{param.label}}</div>
                            <input type="text" name="{{param.name}}" value="{{param.def_value}}"
                                   class="form-control {{param.type}}" placeholder="{{param.hint}}"
                                   required="required"/>
                        </div>
                    </div>
                    {% endfor %}
                    {% endif %}
                </td>
                <td>
                    <input class="btn btn-primary btn-xs" type="submit" value="获取"/>
                </td>
                <td>
                    {% if item.history %}
                    {{ moment(item.history).format('YYYY年M月D日, h:mm:ss a') }}
                    {% else %}
                    暂无记录
                    {% endif %}
                </td>
            </form>
        </tr>
        {% endfor %}
        </tbody>
    </table>
</div>

{% endblock %}